﻿<section>
  <div class="spinner-wrapper col-lg-12 col-md-12 col-sm-12 col-xs-12" ng-show="vm.isLoading">
    <svg class="spinner-container" viewBox="0 0 44 44">
      <circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle>
    </svg>
  </div>

  <div class="page-header">
    <h1>
      Articles
      <a class="btn btn-primary pull-right" data-ui-sref="admin.articles.create">
        <i class="glyphicon glyphicon-plus"></i>
      </a>
    </h1>
  </div>
  <div class="list-group">
    <a data-ng-repeat="article in vm.articles" data-ui-sref="admin.articles.edit({articleId: article._id})" class="list-group-item">
      <div ng-if="!article.toPublish">
        <h3>
          <span class="label label-warning">
            <span class="fa fa-eye-slash">
                未发布的条目
            </span>
          </span>
        </h3>
      </div>

      <small class="list-group-item-text">
        由
        <span ng-if="article.user" ng-bind="article.user.displayName"></span>
        <span ng-if="!article.user">Deleted User</span>
          发表于
        <span data-ng-bind="article.created | date:'yyyy-MM-dd HH:mm'"></span>
      </small>
      <h4 class="list-group-item-heading" data-ng-bind="article.title"></h4>
      <br>
      <div ng-bind-html="article.content"></div>
    </a>
  </div>
  <div class="alert alert-warning text-center" data-ng-if="articles.$resolved && !articles.length">
    No articles yet, why don't you <a data-ui-sref="admin.articles.create">create one</a>?
  </div>

  <div footer-button-more ng-if="vm.showFooter" ng-click="vm.showMore()">
    <button type="button" class="btn btn-sm btn-info btn-block">
      <span class="fa fa-ravelry fa-lg" aria-hidden="true">
        &nbsp;&nbsp;更多...
      </span>
    </button>
  </div>
</section>
